require(['./config'],()=>{
    require(['jquery'],()=>{
        class Login{
            constructor(){
                this. getNameData()
            }
            getNameData(){
                const _this=this
                $('#login').on('click',function(){
                    console.log(77)
                    let email=$('.email').val()
                    let password=$('.password').val()
                    let userNameArr= new Array(localStorage.length)
                    for(var i=0;i<localStorage.length;i++){
                        userNameArr[i] = localStorage.key(i);
                    }
                    if(userNameArr.includes(email)){
                       let storepwd=localStorage.getItem(email)
                       if(storepwd===email){
                           location.href="index.html"
                       }else{
                           alert('密码错误，请重试！')
                       }
                    }else{
                        alert('用户名不存在')
                    }
                })
            }
        }
        new Login()
    })
})